<form class="layui-form seller-form" action="">
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this"><a href="{:url('homeList')}">服务费详情</a></li>
            <li><a href="{:url('homeListTwo')}" >其他详情</a></li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-sm" lay-submit lay-filter="all">更新全部</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="table-body">
            <table id="balanceTable" lay-filter="balanceTable"></table>
        </div>
    </div>
</form>

<script>
    layui.use(['form', 'laydate', 'table',], function () {
        var laydate = layui.laydate,
            form = layui.form,
            table = layui.table; //表格
        table.render({
            elem: '#balanceTable',
            height: 'full-99',
            cellMinWidth: '80',
            //totalRow: true,
            method: 'post',
            url: "{:url('Toolbar/homeList')}",
            id: 'balanceTable',
            cols: [[
                { type: 'numbers'},
                { align: 'center', title: '统计时间',width:170,
                    templet: function (d) {
                        return layui.util.toDateString(d.ctime * 1000, "yyyy-MM-dd HH:mm:ss");
                    }
                },
                { field: 'data',  align: 'center', title: 'Type',width: 100},
                {field: 'open_amount_all', title: '开卡服务费', align:"right",
                    style:'color:#FF5722;font-weight:bold' , width:150},
                {field: 'server_amount_all', title: '卡充值服务费', align:"right",
                    style:'color:#FF5722;font-weight:bold' , width:150},
                {field: 'refund_amount_all', title: '退款服务费', align:"right",
                    style:'color:#FF5722;font-weight:bold' , width:150},
                {field: 'profit', title: '利润(开卡+充值+退款)', align:"right",
                    style:'color:#FF5722;font-weight:bold' , width:180},
                {field: 'profit_cd', title: 'Comdata(拒付+0验证)', align:"right",
                    style:'color:#FF5722;font-weight:bold' , width:180},
                {field: 'profit_lss', title: 'Connexpay(拒付+0验证)', align:"right",
                    style:'color:#FF5722;font-weight:bold' , width:180},
                {field: 'balance_all', title: '卡余额(总)', align:"right",
                    style:'color:#FF5722;font-weight:bold' , width:150},
                {field: 'balance_account_all', title: '卡限额(总)', align:"right",
                    style:'color:#FF5722;font-weight:bold' , width:150},
            ]],
            page: true,
            limit: 20,
            limits: [20, 100, 1000,5000],
        });
        form.on('submit(all)', function (data) {
            var loading =layer.load(1, {shade: [0.1,'#fff']});
            JsPost("{:url('homeOne')}", {is_all_up:1},function(res){
                layer.close(loading);
                if(res.code >0){
                    layer.msg(res.msg, { time: 1500 , icon:1}, function () {
                        window.location.href = "{:url('homeList')}";
                    });
                }else{
                    layer.msg(res.msg , {time: 1500 , icon:2});
                }
            })
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>